using System.Collections.Generic;

namespace IQIGame.Onigao.GamePlay
{ 
    public sealed class PlayerCommandQueue
    {
        private Queue<PlayerCommand> commands = new Queue<PlayerCommand>();

        public void Add(PlayerCommand command)
        {
            commands.Enqueue(command);
        }

        public PlayerCommand Next()
        {
            if (commands.TryDequeue(out var cmd))
            {
                return cmd;
            }
            return null;
        }

        public void Clear()
        {
            commands.Clear();
        }
    }
}